<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>数据类型转换之简单加法器案例</title>
    <script>
        var str_num1 = prompt('请输入第一个值: ');
        var str_num2 = prompt('请输入第二个值: ');
        var res = parseFloat(str_num1) + parseFloat(str_num2);
        alert('结果是: ' + res);
    </script>
</head>
<body>
    
</body>
</html>